package io.renren.service.impl;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.google.common.collect.Maps;

import io.renren.dao.ICountryDao;
import io.renren.entity.Contient;
import io.renren.entity.Country;
import io.renren.service.ICountryService;

@Service("countryServiceImpl")
public class CountryServiceImpl implements ICountryService {
	
	private static final String IMG_FILE_PATH = "d:\\img\\";
	
	@Autowired
	private ICountryDao countryDao;

	@Override
	public List<Country> queryList(Map<String, Object> map) {
		return countryDao.queryList(map);
	}

	@Override
	public int queryTotal(Map<String, Object> map) {
		return countryDao.queryTotal(map);
	}
	
	@Override
	public List<Country> queryAll() {
		return countryDao.queryList(Maps.newHashMap());
	}

	@Override
	public List<Contient> queryAllContient() {
		return countryDao.queryAllContient();
	}

	@Override
	public Country queryObject(Long id) {
		return countryDao.queryObject(id);
	}

	@Override
	public void deleteBatch(Long[] ids) {
		countryDao.deleteBatch(ids);
	}

	@Override
	public void save(Country country) {
		countryDao.save(country);
	}

	@Override
	public void update(Country country) {
		countryDao.update(country);
	}

	public static void main(String[] args) throws Exception {
		String fileName = "SAF.xxx.png";
		System.out.println(fileName.substring(fileName.lastIndexOf(".") + 1));
	}

}
